package com.bilicute.libman.mapper;

import com.bilicute.libman.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

//@Mapper
public interface UserMapper {
    User findByUserName(String user_name);

    User getUserByEmail(String mail);

    @Insert("insert into user( user_name , user_password , user_email , user_role , user_status ) " +
            "value(#{username},#{password},#{mail},#{user_role},0)")
    void register(String username, String password, String mail ,String user_role);

    @Select("select * from user where user_id =#{userId}")
    User findByUserId(Integer userId);

    @Select("SELECT COUNT(*) FROM user")
    Integer getAllNum();
}
